package com.cn.configuration;

import com.cn.service.impl.AttackServiceImpl;
import com.cn.service.impl.DataSourceServiceImpl;

/**
 * @author chenming
 * @version 1.0
 * Date 2022/9/23 16:22
 */
public class InitialContext {

    public Object lookup(String name){
        if (name.equals("DataSourceServiceImpl"))
        {
            System.out.println("Looking up and creating a new "+name+" object");
            return new DataSourceServiceImpl();
        }else if (name.equals("AttackServiceImpl"))
        {
            System.out.println("Looking up and creating a new "+name+" object");
            return new AttackServiceImpl();
        }
        return null;
    }
}
